<route lang="json5">
{
  style: {
    navigationStyle: 'custom',
  },
}
</route>

<template>
  <view>
    <!-- 顶部导航栏 -->
    <wd-navbar
      title="学情分析"
      left-arrow
      safeAreaInsetTop
      @click-left="handleClickLeft"
    ></wd-navbar>
    <!-- 导航标签 -->
    <wd-tabs v-model="state.activeTab">
      <wd-tab v-for="(item, index) in state.tabsList" :key="index" :title="item" />
    </wd-tabs>
    <!-- 内容 -->
    <view>
      <!-- 课程学习 -->
      <CourseLearning v-if="state.activeTab === 0" />
      <!-- 作业完成 -->
      <JobCompletes v-if="state.activeTab === 1" />
    </view>
  </view>
</template>

<script setup lang="ts">
/* 引入 组件 */
import CourseLearning from './components/courseLearning.vue'
import JobCompletes from './components/jobCompletes.vue'

/* 定义数据 */
const state = reactive({
  activeTab: 0,
  tabsList: ['课程学习', '作业完成'],
})

/* 顶部导航栏 - 返回 */
function handleClickLeft() {
  uni.navigateBack()
}
</script>

<style lang="scss" scoped>
:deep(.wd-navbar)::after {
  display: none !important;
}
</style>
